import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/*
*
* "设置"----账号与安全
*
*
* */
class AccountSecurityPage extends StatefulWidget {
  const AccountSecurityPage({Key key}) : super(key: key);

  @override
  _AccountSecurityPageState createState() => _AccountSecurityPageState();
}

class _AccountSecurityPageState extends State<AccountSecurityPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        centerTitle: true,
        leading: IconButton(
          icon: Icon(Icons.arrow_back_ios, color: Colors.black),
          onPressed: () {
            ///界面返回
            Navigator.of(context).pop();
            print("返回");
          },
        ),
        backgroundColor: Colors.white,
        elevation: 1,
        title: Text(
          "账号与安全",
          style: TextStyle(fontSize: 18, color: Color.fromRGBO(17, 17, 17, 1)),
        ),
      ),
      body: Column(
        children: <Widget>[
          //手机号
          myTelephone(),

          Container(
            height: 12,
            color: Color.fromRGBO(243, 243, 243, 1),
          ),
          //其他方式登录
          otherLogin(),

          //QQ
          myQQ(),

          //微信绑定
          wechatBinding(),

          //微博绑定
          microblogBinding(),
        ],
      ),
    );
  }

  ///手机号
  Widget myTelephone() {
    return GestureDetector(
      onTap: () {
        print("----------------接收推送通知-----------------");
      },
      child: Container(
        height: 48,
        width: MediaQuery.of(context).size.width - 32,
        margin: EdgeInsets.only(left: 16, right: 16, top: 12),
        child: Row(
          children: <Widget>[
            Text(
              "手机号",
              style:
                  TextStyle(fontSize: 16, color: Color.fromRGBO(17, 17, 17, 1)),
            ),
            Spacer(),
            Text(
              "138****8749",
              style:
                  TextStyle(fontSize: 16, color: Color.fromRGBO(51, 51, 51, 1)),
            ),
            Container(
              margin: EdgeInsets.only(left: 12),
              child: Icon(
                Icons.arrow_forward_ios_sharp,
                size: 18,
                color: Color.fromRGBO(112, 112, 112, 1),
              ),
            )
          ],
        ),
      ),
    );
  }

  ///其他方式登录
  Widget otherLogin() {
    return Container(
      height: 32,
      color: Color.fromRGBO(243, 243, 243, 1),
      width: MediaQuery.of(context).size.width,
      padding: EdgeInsets.only(left: 16),
      child: Text(
        "其他方式登录",
        style: TextStyle(fontSize: 14, color: Color.fromRGBO(153, 153, 153, 1)),
      ),
    );
  }

  ///QQ
  Widget myQQ() {
    return GestureDetector(
      onTap: () {
        print("----------------QQ-----------------");
      },
      child: Container(
        height: 48,
        width: MediaQuery.of(context).size.width - 32,
        margin: EdgeInsets.only(left: 16, right: 16, top: 12),
        decoration: BoxDecoration(
            border: Border(
                bottom: BorderSide(
                    color: Color.fromRGBO(153, 153, 153, 0.2),
                    width: 1,
                    style: BorderStyle.solid))),
        child: Row(
          children: <Widget>[
            Text(
              "QQ",
              style:
                  TextStyle(fontSize: 16, color: Color.fromRGBO(17, 17, 17, 1)),
            ),
            Spacer(),
            Text(
              "Stormy Van",
              style:
                  TextStyle(fontSize: 16, color: Color.fromRGBO(51, 51, 15, 1)),
            ),
            Container(
              margin: EdgeInsets.only(left: 12),
              child: Icon(
                Icons.arrow_forward_ios_sharp,
                size: 18,
                color: Color.fromRGBO(112, 112, 112, 1),
              ),
            )
          ],
        ),
      ),
    );
  }

  ///微信绑定
  Widget wechatBinding() {
    return GestureDetector(
      onTap: () {
        print("----------------微信绑定-----------------");
      },
      child: Container(
        height: 48,
        width: MediaQuery.of(context).size.width - 32,
        margin: EdgeInsets.only(left: 16, right: 16, top: 12),
        decoration: BoxDecoration(
            border: Border(
                bottom: BorderSide(
                    color: Color.fromRGBO(153, 153, 153, 0.2),
                    width: 1,
                    style: BorderStyle.solid))),
        child: Row(
          children: <Widget>[
            Text(
              "微信绑定",
              style:
                  TextStyle(fontSize: 16, color: Color.fromRGBO(17, 17, 17, 1)),
            ),
            Spacer(),
            Text(
              "去绑定",
              style: TextStyle(
                  fontSize: 16, color: Color.fromRGBO(153, 153, 153, 1)),
            ),
            Container(
              margin: EdgeInsets.only(left: 12),
              child: Icon(
                Icons.arrow_forward_ios_sharp,
                size: 18,
                color: Color.fromRGBO(112, 112, 112, 1),
              ),
            )
          ],
        ),
      ),
    );
  }

  ///微博绑定
  Widget microblogBinding() {
    return GestureDetector(
      onTap: () {
        print("----------------微博绑定-----------------");
      },
      child: Container(
        height: 48,
        width: MediaQuery.of(context).size.width - 32,
        margin: EdgeInsets.only(left: 16, right: 16, top: 12),
        decoration: BoxDecoration(
            border: Border(
                bottom: BorderSide(
                    color: Color.fromRGBO(153, 153, 153, 0.2),
                    width: 1,
                    style: BorderStyle.solid))),
        child: Row(
          children: <Widget>[
            Text(
              "微博绑定",
              style:
                  TextStyle(fontSize: 16, color: Color.fromRGBO(17, 17, 17, 1)),
            ),
            Spacer(),
            Text(
              "去绑定",
              style: TextStyle(
                  fontSize: 16, color: Color.fromRGBO(153, 153, 153, 1)),
            ),
            Container(
              margin: EdgeInsets.only(left: 12),
              child: Icon(
                Icons.arrow_forward_ios_sharp,
                size: 18,
                color: Color.fromRGBO(112, 112, 112, 1),
              ),
            )
          ],
        ),
      ),
    );
  }


}
